Presently, microcontrollers are used in a wide variety of commercial products such as refrigerators, cellular telephones, and automotive antilock braking systems. Microcontrollers are data processing devices having both a central processing unit (CPU) for executing conventional microprocessor software instructions, and peripheral devices. Here the term "peripheral" is used generally and means all devices peripheral to the CPU, including both input/output devices and memory devices. The CPU and peripherals typically are interconnected via a common internal bus. Because both CPU and peripheral functions are implemented on a single integrated circuit, microcontrollers are useful for cost-sensitive control functions. Some microcontrollers, known as single-chip microcontrollers, have all program memory on-chip and do not connect to an external bus to access off-chip memory. Thus, pin count may be reduced to a minimum, reducing cost even further. These single-chip microcontrollers are useful for the most cost-sensitive applications.
Reliability is important for commercial products using single-chip microcontrollers, and requires the integrated circuit manufacturer to sufficiently test the microcontroller's circuitry before shipping the device. Thus it is necessary to test both the CPU and the on-chip peripherals. While it is relatively easy to test the CPU by passing instruction operation codes (opcodes) to the CPU through available input/output (I/O) pins, testing memory-mapped peripherals in known single-chip microcontrollers is more problematic. The CPU accesses memory-mapped peripherals by performing read and write cycles to one or more selected addresses. To perform a functional test, the CPU must fetch both an opcode and an address from the I/O pins and then execute these instructions, for each memory-mapped register which must be initialized. To determine the test result, the CPU must fetch both an opcode and an address of a memory-mapped register which indicates the result, execute the instruction, fetch another opcode and address of the I/O pins, and then execute the instruction. Thus, most test time is consumed in overhead cycles to the CPU. Even if the peripheral includes scan testing circuitry, it is still necessary for the CPU to write the test data to the peripheral's memory-mapped scan circuitry and to read the output, thus requiring many overhead cycles for opcode fetching and accessing the I/O pins. What is needed, then, is a more cost-effective way to reliably test a single-chip microcontroller.